package com.ptmall.app.net.base;

import com.google.gson.annotations.SerializedName;

/**
 * Created by liukun on 16/3/5.
 */
public class Result<T> {

    @SerializedName("status")
    private int status;

    @SerializedName("info")
    private String info;

    //用来模仿Data
    @SerializedName("data")
    private T data;


    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Boolean isSuccess() {
        return status == 0 ? false : true;
    }


    @Override
    public String toString() {
        return "Result{" +
                "status=" + status +
                ", info='" + info + '\'' +
                ", data=" + data +
                '}';
    }
}
